import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/', component: () => import('../views/HomeView.vue'),
    children: [
      { path: '/', redirect: '/Map' },
      { path: '/Map', name: 'Map', component: () => import('../components/Home/Map.vue') },
      { path: '/User', name: 'User', component: () => import('../components/Home/User.vue') },
      { path: '/Point', name: 'Point', component: () => import('../components/Home/Point.vue') },
      { path: '/Apply_admin', name: 'ApplyAdmin', component: () => import('../components/Home/ApplyAdmin.vue') },
      { path: '/Apply_point', name: 'ApplyPoint', component: () => import('../components/Home/ApplyPoint.vue') },
    ]
  },
  {
    path: '/login', name: 'login', component: () => import('../views/LoginView.vue')
  },
]

const router = new VueRouter({
  // mode: 'history',
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
